# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=monocle
pkgver=1.0
pkgrel=5
groups=('blackarch' 'blackarch-recon' 'blackarch-networking')
pkgdesc='A local network host discovery tool. In passive mode, it will listen for ARP request and reply packets. In active mode, it will send ARP requests to the specific IP range. The results are a list of IP and MAC addresses present on the local network.'
arch=('x86_64' 'aarch64')
url='http://packetstormsecurity.com/files/99823/Monocle-Host-Discovery-Tool-1.0.html'
license=('GPL3')
source=("https://dl.packetstormsecurity.net/UNIX/utilities/$pkgname-$pkgver.tar.gz")
sha512sums=('92ab397770f2420bd9ebe25a40921c49f432aa2c8938e5480fe55b938dae90c86ac9546c2f7934976cd281f4978bc2a3796fdbd52607642814367da8d2b01a5a')

build() {
  cd "$pkgname-$pkgver"

  ./configure --prefix=/usr

  # Makefile needs to be fixed. we go with this:
  cd src
  gcc error.c main.c mem.c netconf.c socket.c -O0 -W -o ../$pkgname
}

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" AUTHORS BUG INSTALL NEWS \
    README
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

